<?php

$startTime = microtime(true);

function myCurl($url, $data, $type = 0)
{
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HEADER, false);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
    curl_setopt($ch, CURLOPT_TIMEOUT, 5);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
    $data = curl_exec($ch);

    if ($type) {
        return $data;
    }

    return json_decode($data, true);
}

$url = 'http://54.169.107.232:8888/v1/chain/get_info';
$data = [];
$type = 0;
var_dump(myCurl($url, $data, $type));

echo  microtime(true) - $startTime;
echo "\n";